XEN_TARGET_X86_PAE ?= n
XEN_OS ?= $(shell uname -s)
+CONFIG_$(XEN_OS) := y
+
# Tools to run on system hosting the build
HOSTCC = gcc
HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
CONFIG_IA64 := y
+CONFIG_IA64_$(XEN_OS) := y
+
CONFIG_IOEMU := y
CONFIG_XCUTILS := y
CONFIG_POWERPC := y
+CONFIG_POWERPC_$(XEN_OS) := y
CFLAGS += -DELFSIZE=64
LIBDIR := lib
CONFIG_X86 := y
+CONFIG_X86_$(XEN_OS) := y
+
CONFIG_HVM := y
CONFIG_MIGRATE := y
CONFIG_XCUTILS := y
CONFIG_X86 := y
+CONFIG_X86_$(XEN_OS) := y
+
CONFIG_HVM := y
CONFIG_MIGRATE := y
CONFIG_XCUTILS := y
include $(XEN_ROOT)/Config.mk
-CONFIG_$(shell uname -s) := y
-
XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
XEN_LIBXC = $(XEN_ROOT)/tools/libxc
XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore
#include <unistd.h>
#include <errno.h>
#include <xenctrl.h>
-#include <thread_db.h>
-#include <xc_ptrace.h>
#define TRACE_ENTER /* printf("enter %s\n", __FUNCTION__) */
CTRL_SRCS-y += xc_sedf.c
CTRL_SRCS-y += xc_csched.c
CTRL_SRCS-y += xc_tbuf.c
-CTRL_SRCS-$(CONFIG_X86) += xc_ptrace.c xc_ptrace_core.c xc_pagetab.c
+CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
+CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
GUEST_SRCS-y :=
GUEST_SRCS-y += xc_load_bin.c
#define DECLARE_SYSCTL struct xen_sysctl sysctl
#endif
+#undef PAGE_SHIFT
+#undef PAGE_SIZE
+#undef PAGE_MASK
#define PAGE_SHIFT XC_PAGE_SHIFT
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
-#define XC_PTRACE_PRIVATE
-
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <time.h>
#ifndef XC_PTRACE_
#define XC_PTRACE_
-#include <thread_db.h>
-
-#ifdef XC_PTRACE_PRIVATE
#define X86_CR0_PE 0x00000001 /* Enable Protected Mode (RW) */
#define X86_CR0_PG 0x80000000 /* Paging (RW) */
#define BSD_PAGE_MASK (PAGE_SIZE-1)
}
#endif
-#endif
-
-typedef void (*thr_ev_handler_t)(long);
-
-void xc_register_event_handler(
- thr_ev_handler_t h,
- td_event_e e);
-
-long xc_ptrace(
- int xc_handle,
- enum __ptrace_request request,
- uint32_t domid,
- long addr,
- long data);
-
-int xc_waitdomain(
- int xc_handle,
- int domain,
- int *status,
- int options);
-
#endif /* XC_PTRACE */
-#define XC_PTRACE_PRIVATE
-
#include <sys/ptrace.h>
#include <sys/wait.h>
#include "xc_private.h"
#include <stddef.h>
#include <stdint.h>
-#include <sys/ptrace.h>
#include <xen/xen.h>
#include <xen/domctl.h>
#include <xen/sysctl.h>
* DOMAIN DEBUGGING FUNCTIONS
*/
+#ifdef __linux__
+
+#include <sys/ptrace.h>
+#include <thread_db.h>
+
typedef struct xc_core_header {
unsigned int xch_magic;
unsigned int xch_nr_vcpus;
int *status,
int options,
vcpu_guest_context_t *ctxt);
+typedef void (*thr_ev_handler_t)(long);
+
+void xc_register_event_handler(
+ thr_ev_handler_t h,
+ td_event_e e);
+
+long xc_ptrace(
+ int xc_handle,
+ enum __ptrace_request request,
+ uint32_t domid,
+ long addr,
+ long data);
+
+int xc_waitdomain(
+ int xc_handle,
+ int domain,
+ int *status,
+ int options);
+
+#endif /* __linux__ */
/*
* DOMAIN MANAGEMENT FUNCTIONS
#define L4_PAGETABLE_ENTRIES 512
#endif
-#define PAGE_SHIFT XC_PAGE_SHIFT
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-
typedef uint32_t l1_pgentry_32_t;
typedef uint32_t l2_pgentry_32_t;
typedef uint64_t l1_pgentry_64_t;